<!DOCTYPE html>
<html lang="zh">
	<head>
		<meta charset="UTF-8">
		<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" />
		<meta http-equiv="X-UA-Compatible" content="ie=edge">
		<title>我的</title>
		<link rel="stylesheet" href="/index/css/common.css?v=6">
		<link rel="stylesheet" href="/index/css/mine.css?v=8">
		<script type="text/javascript" src="/index/js/jquery-3.4.1.min.js"></script>
		<script type="text/javascript" src="/index/js/common.js?v=4"></script>

		<style>
			.leal_up{position: absolute;right:0;top:90px;}
			.mine{background: #fff;}
		</style>
	</head>
	<body>
		<div class="tabsBox">
			<div class="topTab">
				<div class="tabLeft" ><img src="/index/assets/left.png" ></div>
				<div class="tabCenter">我的</div>
<!--				<div class="tabCenter">我的</div>-->
				<div class="tabRight">{if !isWeixin()}<a href="/index/index/login">退出</a>{/if}</div>
			</div>
		</div>
		<div class="mine">
			<div class="m_top cleardrift">
				<div class="m_img">
<!--					<img src="https://dss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=3256100974,305075936&fm=26&gp=0.jpg">-->
					<img src="{$user.avatar}">
				</div>
				<div class="m_infor">
					<div class="m_title"> <span class="nickname">{$user.nickname}</span> <img src="/index/assets/icon/edit.png" alt="" onclick="showUpd()"></div>
					<div class="m_phone">{$user.phone}</div>


					<div>

						{if $user['sales_validity']>$time}
							<span style="padding:5px 10px;background: #ccc;color:#fff;border-radius: 3px;font-size:12px;">{$info.sales_name}</span>
						{else/}
							{if $user.level_validity>time()}
							<span>有效期至: {$user.level_validity|date='Y-m-d H:i'}</span>
							{else/}
							<span style="padding:5px 10px;background: #ccc;color:#fff;border-radius: 3px;font-size:12px;">普通用户</span>
							{/if}
						{/if}
					</div>
				</div>

<!--				<div class="leal_up"><a href="{:url('salesLevel')}" style="color:#fff">开通特权</a></div>-->
			</div>

			{if $user['sales_validity']>$time}
			<div class="m_profit">
				<div class="m_profitBox">
					<a class="m_profitlist" href="{:url('earnings/waitprofit')}">
						<p class="m_profixNum">{$user.earnings}</p>
						<p class="m_profitWait">待领收益</p>
					</a>
					<a class="m_profitlist" href="{:url('mine/invite')}">
						<p class="m_profixNum">{$son}</p>
						<p class="m_profitWait">邀请好友</p>
					</a>
					<a class="m_profitlist" href="{:url('earnings/wallet')}">
						<p class="m_profixNum">{$user.money}</p>
						<p class="m_profitWait">钱包</p>
					</a>
					<a class="m_profitlist" href="{:url('mine/inviterecord')}">
						<p class="m_profixNum">{$pay_son}</p>
						<p class="m_profitWait">充值好友</p>
					</a>
				</div>
			</div>
			{/if}

			<!--<div class="showImg">-->
				<!--<img src="/index/assets/bac.png">-->
			<!--</div>-->



			<div class='other cleardrift'>

				<a href="{:url('mine/record')}">
					<div class='title cleardrift'>
						<img src='/index/assets/my_icon/lesson.png' class='logo'></img>
						<div class='jifen'>观影记录</div>
						<img src='/index/assets/7.png' class='you'></img>
					</div>
				</a>

				<a href="{:url('level')}">
					<div class='title cleardrift'>
						<img src='/index/assets/my_icon/vip.png' class='logo'></img>
						<div class='jifen'>打赏主播</div>
						<img src='/index/assets/7.png' class='you'></img>
					</div>
				</a>

				<a href="{:url('salesLevel')}">
					<div class='title cleardrift'>
						<img src='/index/assets/my_icon/sales.png' class='logo'></img>
						<div class='jifen'>加入粉丝团</div>
						<img src='/index/assets/7.png' class='you'></img>
					</div>
				</a>
				{if $user['sales_validity']>$time}


				<a href="{:url('earnings/index')}">
					<div class='title cleardrift'>
						<img src='/index/assets/my_icon/money.png' class='logo'></img>
						<div class='jifen'>收益中心</div>
						<img src='/index/assets/7.png' class='you'></img>
					</div>
				</a>

				<a href="{:url('invite')}">
				<div class='title cleardrift'>
					<img src='/index/assets/my_icon/invite.png' class='logo'></img>
					<div class='jifen'>我的邀请</div>
					<img src='/index/assets/7.png' class='you'></img>
				</div>
				</a>
				{/if}

<!--				<a href="{:url('explain/help')}">-->
<!--				<div class='title cleardrift'>-->
<!--					<img src='/index/assets/my_icon/help.png' class='logo'></img>-->
<!--					<div class='jifen'>新手帮助</div>-->
<!--					<img src='/index/assets/7.png' class='you'></img>-->
<!--				</div>-->
<!--				</a>-->
				<a href="{:url('explain/index')}?type=2">
				<div class='title cleardrift'>
					<img src='/index/assets/my_icon/link.png' class='logo'></img>
					<div class='jifen'>联系我们</div>
					<img src='/index/assets/7.png' class='you'></img>
				</div>
				</a>
				<a href="{:url('bindPhone')}">
					<div class='title cleardrift'>
						<img src='/index/assets/my_icon/phone.png' class='logo'></img>
						<div class='jifen'>绑定手机</div>
						<img src='/index/assets/7.png' class='you'></img>
					</div>
				</a>
			</div>
		</div>


		<div style="width:100%;height:100%;background:rgba(0,0,0,0.5);position: fixed;top:0;bottom:0;z-index:1000;text-align: center;display: none;" id="updBox">
			<div style="margin:auto;background: #fff;display: inline-block;margin-top:50%;padding:10px;border-radius: 3px;position: relative">
				<img src="/index/assets/close2.png" id="closeUpd" style="background:#fff;border-radius: 50%;width:35px;height:35px;position: absolute;top:-20px;right:-20px;" alt="">

				<input type="text" value="{$user.nickname}" id="nickname" maxlength="15" style='border-bottom:1px solid #ccc;display: block;font-size:16px;padding:5px;' autofocus>
<!--				<button style="border:none;outline: none;padding:5px 15px;margin-top:10px;background: #ccc;color:#fff;border-radius: 3px;">取消</button>-->
				<button style="border:none;outline: none;padding:5px 15px;margin-top:10px;background: #333333;color:#fff;border-radius: 3px;" id="updUser">确定修改</button>
			</div>
		</div>

		<div style="width:90%;margin:auto;margin-top:20px;">
			{$explain}
		</div>
		{include file='common/menu'}
		{include file='common/toast'}

	</body>

	<script>

		$('#updUser').click(function(){

			var nickname = $('#nickname').val();

			if(nickname){
				$.post('{:url("mine/updName")}',{nickname:nickname},function(res){
					if(res.code==200){
						$('.nickname').text(nickname);
						$('#updBox').hide();

					}else{
						toastFail(res.msg);
						$('#updBox').hide();
					}
				},'json')
			}
		})

		$('#closeUpd').click(function(){
			$('#updBox').hide();
		})

		function showUpd(){
			$('#updBox').show();
			$('#nickname').val($('.nickname').text());
		}
	</script>
</html>
